package com.ruoyi.dynamic.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dynamic.mapper.UserPartyMapper;
import com.ruoyi.dynamic.domain.UserParty;
import com.ruoyi.dynamic.service.IUserPartyService;

/**
 * 用户派对Service业务层处理
 * 
 * @author DEREK
 * @date 2023-12-05
 */
@Service
public class UserPartyServiceImpl extends ServiceImpl<UserPartyMapper, UserParty> implements IUserPartyService 
{
    @Autowired
    private UserPartyMapper userPartyMapper;

    /**
     * 查询用户派对
     * 
     * @param id 用户派对主键
     * @return 用户派对
     */
    @Override
    public UserParty selectUserPartyById(Long id)
    {
        return userPartyMapper.selectUserPartyById(id);
    }

    /**
     * 查询用户派对列表
     * 
     * @param userParty 用户派对
     * @return 用户派对
     */
    @Override
    public List<UserParty> selectUserPartyList(UserParty userParty)
    {
        return userPartyMapper.selectUserPartyList(userParty);
    }

    /**
     * 新增用户派对
     * 
     * @param userParty 用户派对
     * @return 结果
     */
    @Override
    public int insertUserParty(UserParty userParty)
    {
        userParty.setCreateTime(DateUtils.getNowDate());
        return userPartyMapper.insertUserParty(userParty);
    }

    /**
     * 修改用户派对
     * 
     * @param userParty 用户派对
     * @return 结果
     */
    @Override
    public int updateUserParty(UserParty userParty)
    {
        userParty.setUpdateTime(DateUtils.getNowDate());
        return userPartyMapper.updateUserParty(userParty);
    }

    /**
     * 批量删除用户派对
     * 
     * @param ids 需要删除的用户派对主键
     * @return 结果
     */
    @Override
    public int deleteUserPartyByIds(Long[] ids)
    {
        return userPartyMapper.deleteUserPartyByIds(ids);
    }

    /**
     * 删除用户派对信息
     * 
     * @param id 用户派对主键
     * @return 结果
     */
    @Override
    public int deleteUserPartyById(Long id)
    {
        return userPartyMapper.deleteUserPartyById(id);
    }
}
